<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="password" name="name" placeholder="请不要输入空格">
<script>
    let s = "100";
    let s1 = new String("100");
    console.log(s == s1);
    console.log(s === s1);
    console.log(s.charAt(1));
    console.log(s.charCodeAt(1));
    console.log(s + "123" + "abc");
    console.log(s.concat("123", "abc"));

    s = s + "123" + "abc";// 100123abc
    /*
        substring(start, end)：start开始的索引，end结束的索引，正数从左到右，负数从右到左。不包括结尾字符
        substr(from, length)：从form开始截取length长度
        s.slice(start, end)：不支持负数，不包括结尾字符
     */
    console.log(s.slice(1, 3));
    console.log(s.substring(1, 3));
    console.log(s.substr(1, 3));
    console.log(s.indexOf("1"));
    console.log(s.indexOf("ab"));
    console.log(s.lastIndexOf("1"));
    console.log(s.startsWith("100"));
    console.log(s.endsWith("abc"));
    console.log(s.includes("00"));
    console.log(s.length);
    s = "   " + s + "   ";
    console.log(s.length);
    console.log(s.trim().length)

    // 兵马未动，粮草先行
    // 操，cao，草
    console.log("兵马未动，粮草先行，粮草先行".replace("草", "*"));
    // 正则表达式
    console.log("兵马未动，粮草先行，粮草先行".replace(/草/g, "*"));
    console.log("hahahahahah".replaceAll("a", "e"));
    console.log("hahahahahah".toUpperCase());
    console.log("jdfjdkADADFJ".toLowerCase());
    // ctrl + shift + x
    console.log("HAHAHAHAHAH" == "hahahahahah");

    console.log(( 5 / 3).toFixed(2));
</script>
</body>
</html>